from spaghetti import SpaghettiVM

vm = SpaghettiVM()

def say_something(s):
  print s

#attach say_something as interrupt 10 to use register A as input
vm.attach_interrupt(10,say_something,["A"]) 

code = '''
MOV A,"Hello World!"      #Put "Hello World" into register A
INT 10                    #Call interrupt 10 which is hooked up to say_something
'''

vm.execute(code)